<?php

/**
 * Challenge Cup gamelist widget file,
 * @author Luke Barratt 
 * @copyright Copyright (C) 2008 by Luke Barratt
 * @license http://www.gnu.org/copyleft/gpl.html
 */

defined('CC_VALID') or 
die('Direct Access to this location is not allowed.');

// Game listing Query/Array variables

$CC_GAMELIST_QUERY = mysql_query('SELECT * FROM cc_game');

while ($CC_GAMELIST_ARRAY = mysql_fetch_array($CC_GAMELIST_QUERY)) {
	$CC_GAME_ID = $_GET['game_id'];
	if ($CC_GAMELIST_ARRAY['game_id'] == $CC_GAME_ID) {
		echo "<div class=\"game\">";
	}
	else
	{
		echo "<div class=\"item\">";
	}
	echo "<a href=\"index.php?mod=portal&game_id=". $CC_GAMELIST_ARRAY['game_id'] ."\" >". $CC_GAMELIST_ARRAY['game_name'] ."</a>";
	echo "</div>";
}

CC_FREE_RESULT($CC_GAMELIST_QUERY);

?>